﻿namespace ShapesExercise
{
    using System;

    public class MainShapesExercise
    {
        //// Define abstract class Shape with only one abstract method CalculateSurface() and fields width and height. Define two
        //// new classes Triangle and Rectangle that implement the virtual method and return the surface of the figure (height*width
        //// for rectangle and height*width/2 for triangle). Define class Circle and suitable constructor so that at initialization
        //// height must be kept equal to width and implement the CalculateSurface() method. Write a program that tests the
        //// behavior of the CalculateSurface() method for different shapes (Circle, Rectangle, Triangle) stored in an array.

        private static void Main()
        {
            Shape[] sampleShapes = { new Triangle(3, 2), new Rectangle(4, 5), new Circle(6) };

            foreach (var shape in sampleShapes)
            {
                Console.WriteLine(shape.CalculateSurface());
            }
        }
    }
}